<h1>Тоглолтын өдрүүд</h1>

<?php echo link_to('жагсаалт', 'matchday/index', array('class'=>'title'))?> 
<span class="separator"> | </span>
<?php echo link_to('шинээр нэмэх', 'matchday/new', array('class'=>'title'))?>
<br clear="all">
<br clear="all">

<table>
  <thead>
    <tr>
      <th>#</th>
      <th>Тоглолтын Өдөр</th>
      <th>Тоглолтын өдөрийн тухай</th>
      <th>Улирал</th>
      <th>Плэй офф эсэх</th>
      <th></th>
    </tr>
  </thead>
  <tbody>
    <?php $i=0; foreach ($bb_matchdays as $bb_matchday): ?>
	<?php $season = Doctrine::getTable('BbSeason')->findOneBySId($bb_matchday->getSId()); ?>
	<?php $league = Doctrine::getTable('BbLeague')->findOneById($season->getLId()); ?>
    <tr>
      <td><?php echo ++$i?></td>
      <td><?php echo $bb_matchday->getMName() ?></td>
      <td><?php echo $bb_matchday->getMDescr() ?></td>
      <td><?php echo  $league.' :: '.$season; ?></td>
      <td><?php echo $bb_matchday->getIsPlayoff() ?></td>
      <td nowrap>
        <a href="<?php echo url_for('matchday/edit?id='.$bb_matchday->getId()) ?>">Засварлах</a><br><br>
        <a onclick="return confirm('Та итгэлтэй байна уу?')" href="<?php echo url_for('matchday/delete?id='.$bb_matchday->getId()) ?>">Устгах</a>
      </td>  
    </tr>
    <?php endforeach; ?>
  </tbody>
</table>

